<?php 
include_once("../db_connect.php");

$email =  mysql_real_escape_string(htmlentities(trim($_GET['email'])));

$username 	= "";
$password 	= "";

$sql = mysql_query("SELECT * FROM tbl_account where email='".$email."' limit 1 ")or die(mysql_error());
while($row = mysql_fetch_array($sql)){
	$password= base64_decode($row['password']);
	$username = $row['username'];
	//$email = $row['email'];
	
}

$to = $email;
$subject = "Forgot Password from Basciautosales";

$message = '
<html>
	<head>
	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
	<body bgcolor="#FFFFFF" text="#0000FF" link="#FF0000" style="width:100%; text-align:justify; padding:0px; margin:0px;">
  <table style="width:100%;">
        	
			<tr align="center">
            	<td bgcolor="#000000">
					<div style="background-color:#00000; height:120px;" align="left">
						<h1><a href="http://www.bascibsu.net23.net">BASCIAUTOSALES</a></h1>
					</div>
                </td>
            </tr>
			
            <tr style="background-color:#acf947;">
            	<td height="257" bgcolor="#CCCCCC">
					<p>Welcome to BASCIAUTOSALES </p>
					<table>
						<tr>
							<td>username:</td>
							<td bgcolor="#FFFFFF">'.$username.'</td>
						</tr>
						<tr>
							<td>password:</td>
							<td bgcolor="#FFFFFF">'.$password.'</td>
						</tr>
                                              
					</table>
				
					<p>Please keep this email for future use.</br>	
						Note: Please dont reply to this email or else we will not considered it;
					</p>
						</br>
													
				</td>
            </tr>
			
 		</table>	
		

    </body>
</html>';
// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers

$headers .= "From: admin@basciautosales.hol.es \r\nReply-To:  ";

$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" 


echo $mail_sent ? "sent" : "failed";




?>